﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using SMBL.Interface.Database;
using System.Collections.Generic;
/// <summary>
///用于统一参数化的接口
/// </summary>
public class Testsql:ISql
{
    private Object[] key;
    private Object[] value;
    private String sql;
    private List<KeyValuePair<String, Object>> temp;
    private KeyValuePair<String, Object> temppair;
    public Testsql(Object[] Key,Object[] Value,String toSql)
    {
        temp = new List<KeyValuePair<String, Object>>();
        this.key = Key;
        this.value = Value;
        this.sql = toSql;
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    #region ISql 成员

    public List<KeyValuePair<String, Object>> GetParameters()
    {
        for (int i = 0; i < key.Length;i++ )
        {
            temppair = new KeyValuePair<String, Object>((String)key[i],value[i]);
            temp.Add(temppair);
        }
        return temp;
    }

    public String GetSql()
    {
        return this.sql;
    }

    #endregion
}
